In interactive applications such as multiplayer games, many activities associated with the interactive application can be taking place simultaneously. In interactive applications implemented across a distributed computing system (e.g. a client-server architecture), updates about the state of the interactive application need to be periodically provided across the system. For instance, in the context of a location-based parallel reality game, game modules running on client devices used by players may need to invoke certain program elements or services on a game server to return results to the game module.
Many tools exist for invoking program elements/services on remote computing devices to return results to a caller. These tools typically support returning a single return result or value for each particular message sent between the system. This is true for many frameworks, including remote procedure call (RPC) frameworks and other frameworks. These tools typically do not provide a simple way to notify the caller about other things that may have happened in the interactive environment while also returning the result of the particular action the caller was trying to perform. As a result, client devices in an interactive application typically have to make periodic calls to receive updates for the interactive application. This can be inefficient in a distributed interactive application where a client device needs to frequently receive updates from a server in order to properly interact with the application.
Approaches for providing updates in an interactive application include returning multiple values in response to multiple requests to the invoker of the action (i.e. the module or program initiating the call). This approach requires the invoker of an action to explicitly handle all the returned data. This does not provide much flexibility in how the returned data is handled by the caller. For instance, each module or program that initiates a call and receives updates other than those directly relevant to the call has to pass the extra updates on to a special purpose handler. In addition, calls that do not end in success may not be able to provide updates as a typical return style does not provide a mechanism to provide updates. In particular, in a typical return style, returning an exception typically excludes returning a value.